package com.jzr.medical.db1.dto;

import com.jzr.common.util.Convert;
import com.jzr.common.util.U;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import java.time.LocalDate;

@Getter
@Setter
@NoArgsConstructor
@ToString
public class FoodOrderDto {
    private Integer pageNum;
    private Integer pageSize;
    private LocalDate orderDateFrom;
    private LocalDate orderDateTo;
    private String deptCode;
    private String menuName;
    private Integer menuType;
    private String orderByClause;
    public String getOrderByClause(){
        if(U.isBlank(orderByClause)){
            return "order_date";
        }else {
            return Convert.camelToUnderline(orderByClause);
        }
    }
    public Integer getPageNum(){
        return pageNum ==null ? 1 : pageNum;
    }
    public Integer getPageSize(){
        return pageSize==null ? 20:pageSize;
    }
}
